﻿using System;
using System.Collections.Generic;

namespace Sherwood.Content.UpdateServices
{
    /// <summary>
    /// Represents a class that is responsible for creating and publishing a search document to a search service.
    /// </summary>
    public interface ISearchDocumentService
    {
        /// <summary>
        /// Instantiate an empty search document that will be filled by different <see cref="ISearchDocumentModifier"/>s
        /// </summary>
        /// <param name="record">The record that the search document will be created for</param>
        /// <returns>A new search document</returns>
        ISearchDocument CreateDocument(IRecord record);

        /// <summary>
        /// Publish the documents to the search service
        /// </summary>
        /// <param name="documents">Documents to publish</param>
        void PublishDocuments(IEnumerable<ISearchDocument> documents);

        /// <summary>
        /// Delete documents from the search service
        /// </summary>
        /// <param name="recordIds">Ids of records to delete</param>
        void DeleteDocuments(IEnumerable<Guid> recordIds);
    }
}